home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / etc / gdm / PreSession / Default
Encoding:
Text File  |  2009-04-03  |  1.7 KB  |  68 lines

  1. #!/bin/sh
  2. #
  3. # Note that output goes into the .xsession-errors file for easy debugging
  4. #
  5. PATH="/usr/bin/X11:/usr/X11R6/bin:/opt/X11R6/bin:$PATH:/bin:/usr/bin"
  6. OLD_IFS=$IFS
  7.  
  8. gdmwhich () {
  9.   COMMAND="$1"
  10.   OUTPUT=
  11.   IFS=:
  12.   for dir in $PATH
  13.   do
  14.     if test -x "$dir/$COMMAND" ; then
  15.       if test "x$OUTPUT" = "x" ; then
  16.         OUTPUT="$dir/$COMMAND"
  17.       fi
  18.     fi
  19.   done
  20.   IFS=$OLD_IFS 
  21.   echo "$OUTPUT"
  22. }
  23.  
  24. # Set background color
  25. XSETROOT=`gdmwhich xsetroot`
  26. if [ "x$XSETROOT" != "x" ] ; then
  27.  
  28.     CHECKBACKCOLOR="OK"
  29.     if [ "x$GDM_GREETER_TYPE" = "xTHEMED" ]; then
  30.         BACKCOLOR=`gdmflexiserver --command="GET_CONFIG greeter/GraphicalThemedColor $DISPLAY"`
  31.  
  32.         CHECKBACKCOLOR=`echo $BACKCOLOR | sed 's/^\([^ ]*\) .*$/\1/'`
  33.         if [ "x$CHECKBACKCOLOR" = "xOK" ]; then
  34.             BACKCOLOR=`echo $BACKCOLOR | sed 's/^.* \(.*\)$/\1/'`
  35.         else
  36.             BACKCOLOR=""
  37.         fi
  38.     fi
  39.  
  40.     # If we tried to load the themed backgroundcolor, but failed, then try loading plain color
  41.     if [ "x$CHECKBACKCOLOR" != "xOK" ] || [ "x$GDM_GREETER_TYPE" = "xPLAIN" ]; then
  42.  
  43.         # Background type can be 0=None, 1=Image & Color, 2=Color, or 3=Image 
  44.         BACKTYPE=`gdmflexiserver --command="GET_CONFIG greeter/BackgroundType $DISPLAY"`
  45.  
  46.         # Skip if background type does not include a color
  47.         if [ "x$BACKTYPE" = "xOK 1" ] || [ "x$BACKTYPE" = "xOK 2" ]; then
  48.             BACKCOLOR=`gdmflexiserver --command="GET_CONFIG greeter/BackgroundColor $DISPLAY"`
  49.  
  50.             CHECKBACKCOLOR=`echo $BACKCOLOR | sed 's/^\([^ ]*\) .*$/\1/'`
  51.             if [ "x$CHECKBACKCOLOR" = "xOK" ]; then
  52.                 BACKCOLOR=`echo $BACKCOLOR | sed 's/^.* \(.*\)$/\1/'`
  53.             else
  54.                 BACKCOLOR=""
  55.             fi
  56.         fi
  57.     fi
  58.  
  59.     # Default value
  60.      if [ "x$BACKCOLOR" = "x" ]; then
  61.          BACKCOLOR="#76848F"
  62.      fi
  63.  
  64.     "$XSETROOT" -cursor_name left_ptr -solid "$BACKCOLOR"
  65. fi
  66.  
  67. exit 0
  68.